package com.itheima.mq;

/**
 * @author zhanliuzhu
 * @date 2023/10/29
 * @Description
 */

import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消息接收者
 */
@Slf4j
@Component
public class Listener {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = "tianji.queue"),
            exchange = @Exchange(name = "trade.delay.topic",durable = "true",delayed = "true"),
            key ="tianji"
    ))
    public void userListener(Integer integer) {
        log.info("address端接收来自User端的MQ延迟消息{}", integer);
    }


}
